set RECV_LISTEN(MODE) m_mode

proc m_mode {chid raw parent me} {
	global CHANS_$chid
	regexp {:([^ ]+) MODE ([^ ]+) (.+)} $raw -> nick target modestring
	if { $target == $me } {
		# usermode set
		infomsg $parent.console "[tr {You have set mode}] $modestring\n"
	} else {
		# chanmode set
		regexp {([^!]+)![^!]+@[^@]+} $nick -> nick
		set num [set "CHANS_$chid\([string tolower $target]\)"]
		output $parent.chan$num "*** $nick [tr {has set mode}] $modestring\n" darkblue
		raw $chid "NAMES $target"
	}
}
